package com.ruoyi.comment.service.impl;

import java.util.*;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.comment.mapper.SyCommentMapper;
import com.ruoyi.comment.domain.SyComment;
import com.ruoyi.comment.service.ISyCommentService;

/**
 * 评论Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-31
 */
@Service
public class SyCommentServiceImpl implements ISyCommentService
{

    @Autowired
    private SyCommentMapper syCommentMapper;

    /**
     * 查询评论
     *
     * @param id 评论主键
     * @return 评论
     */
    @Override
    public SyComment selectSyCommentById(String id)
    {
        return syCommentMapper.selectSyCommentById(id);
    }

    /**
     * 查询评论列表
     *
     * @param syComment 评论
     * @return 评论
     */
    @Override
    public List<SyComment> selectSyCommentList(SyComment syComment)
    {
        return syCommentMapper.selectSyCommentList(syComment);
    }

    @Override
    public List<SyComment> selectSyComment(SyComment syComment) {
        return syCommentMapper.selectSyComment(syComment);
    }

    /**
     * 新增评论
     *
     * @param syComment 评论
     * @return 结果
     */
    @Override
    public int insertSyComment(SyComment syComment)
    {
        syComment.setCreateTime(DateUtils.getNowDate());
        return syCommentMapper.insertSyComment(syComment);
    }

    /**
     * 修改评论
     *
     * @param syComment 评论
     * @return 结果
     */
    @Override
    public int updateSyComment(SyComment syComment)
    {
        syComment.setUpdateTime(DateUtils.getNowDate());
        return syCommentMapper.updateSyComment(syComment);
    }

    /**
     * 批量删除评论
     *
     * @param ids 需要删除的评论主键
     * @return 结果
     */
    @Override
    public int deleteSyCommentByIds(String[] ids)
    {
        return syCommentMapper.deleteSyCommentByIds(ids);
    }

    /**
     * 删除评论信息
     *
     * @param id 评论主键
     * @return 结果
     */
    @Override
    public int deleteSyCommentById(String id)
    {
        return syCommentMapper.deleteSyCommentById(id);
    }

    @Override
    public List<SyComment> selectSyCommentListByCourseId(String id) {
        return syCommentMapper.selectSyCommentListByCourseId(id);
    }


    @Override
    public List<SyComment> selectSyCommentListByProductId(String id) {
        return syCommentMapper.selectSyCommentListByProductId(id);
    }

    @Override
    public List<SyComment> selectSyCommentListByMicrocircleId(String id) {
        return syCommentMapper.selectSyCommentListByMicrocircleId(id);
    }


}

